<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui"
	xmlns:of="http://omnifaces.org/functions"
	xmlns:pe="http://primefaces.org/ui/extensions"
	template="/templates/main_template.xhtml">

	<ui:define name="header">
		<script type="text/javascript">
			//<![CDATA[
			//debe usarse los \\:  en lugar de : en los selectores de JQuery
			$(document).ready(function() {
				$("#table_owners_simple").hide();
			});

			function actionsOnSearch() {
				$("#table_owners_simple").show();
				$("#table_owners_pagination").hide();
			}

			//]]>
		</script>
	</ui:define>
	<ui:define name="content">
		<br />
		<h1>
			<h:outputLabel value="#{i18n['lbl.login.title']}" />
		</h1>
		<div id="clearfix">
			<h:form id="form_search_owner" styleClass="clearfix">
				<div class="clearfix common-panel">
					<div class="ui-form-row-2col clearfix">
						<div class="ui-form-col">
							<h:outputLabel value="#{i18n['lbl.list_owner_data.new_owner']}" />
						</div>
						<div class="ui-form-col">
							<p:commandButton value="#{i18n['cmpnt.add']}"
								styleClass="ui-flowbutton"
								actionListener="#{stepByStepController.cancelRuatRegister}"
								oncomplete="currentPage('main_owner_data.xhtml')" />
						</div>
					</div>
				</div>

				<div class="clearfix common-panel">
					<div class="ui-form-col">
						<h2>
							<h:outputLabel value="#{i18n['lbl.list_owner_data.title1']}" />
						</h2>
						<br />
						<h:outputLabel value="#{i18n['lbl.list_owner_data.description']}" />
					</div>
				</div>


				<div id="table_owners_pagination">
					<p:dataTable var="pregister"
						value="#{searchOwnerController.lazyRuatRegisterDataModel}"
						paginator="true" rows="5"
						paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
						rowsPerPageTemplate="5,10,15" lazy="true"
						emptyMessage="#{i18n['cmpnt.no.data']}">
						<!-- 						  <p:ajax event="rowSelect" listener="#{searchOwnerController.onRegisterSelect}" /> -->
						<p:column headerText="#{i18n['lbl.list_owner_data.names']}"
							sortBy="fullName" filterBy="#{pregister.fullName}" width="30%">
							<h:outputLabel value="#{pregister.fullName}" />
						</p:column>
						<p:column headerText="#{i18n['lbl.list_owner_data.lastName']}"
							sortBy="fullLastName" filterBy="#{pregister.fullLastName}"
							width="30%">
							<h:outputLabel value="#{pregister.fullLastName}" />
						</p:column>
						<p:column
							headerText="#{i18n['lbl.list_owner_data.Identification']}"
							sortBy="idNumber" filterBy="#{pregister.idNumber}">
							<h:outputLabel
								value="#{pregister.idTypeDesc} #{pregister.idNumber}"
								width="20%" />
						</p:column>
						<p:column headerText="" width="20%">
							<p:commandButton value="#{i18n['cmpnt.edit']}"
								oncomplete="currentPage('main_owner_data.xhtml')"
								styleClass="ui-flowbutton">
								<f:setPropertyActionListener value="#{pregister}"
									target="#{aSession.selectedRuatRegister}" />
							</p:commandButton>
							<p:commandButton value="#{i18n['cmpnt.delete']}"
								oncomplete="currentPage('delete_confirm_owner_data.xhtml')"
								styleClass="ui-flowbutton">
								<f:setPropertyActionListener value="#{pregister}"
									target="#{aSession.selectedRuatRegister}" />
							</p:commandButton>
						</p:column>
					</p:dataTable>
				</div>


			</h:form>
		</div>

	</ui:define>
</ui:composition>